<%--
$Id: article-list.jsp 13 2010-11-02 15:35:59Z feigme $
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/content/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>List Article</title>
</head>
<body>
<a href="${ctx }/article/new" ><fmt:message key="article.new"/></a>
<table width="100%">
    <tr>
        <td width="30"><fmt:message key="common.id"/></td>
        <td><fmt:message key="article.title"/></td>
        <td><fmt:message key="article.category.name"/></td>
        <td><fmt:message key="article.last.update.date"/></td>
        <td align="center"><fmt:message key="common.action"/></td>
    </tr>
    <c:forEach var="art" items="${list.result}">
    <tr>
        <td><c:out value="${art.id}"/></td>
        <td>
        	<a href="${ctx }/article/<c:out value="${art.id}"/>" title="<c:out value="${art.title}"/>" target="_blank">
        		<c:out value="${art.title}"/>
        	</a>
        </td>
        <td><c:out value="${art.category.name}"/></td>
        <td>
			<fmt:formatDate value="${art.lastUpdateDate}" pattern="yyyy-MM-dd HH:mm:ss" />
		</td>
        <td align="center"><a href="${ctx }/article/<c:out value="${art.id}"/>/edit"><fmt:message key="common.update"/></a></td>
    </tr>
    </c:forEach>
    <tr>
    	<td colspan="5">
    		<c:if test="${list.hasPre}"><a href="${ctx }/article/list/<c:out value="${list.prePage}"/>">&lt;</a></c:if>
    		<c:forEach begin="1" var="page" end="${list.totalPages}">
    			&nbsp;
    			<c:choose>
					<c:when test="${list.pageNo!=page}">
						<a href="${ctx }/article/list/<c:out value="${page}" />">
							<c:out value="${page}" />
						</a>	
					</c:when>
					<c:otherwise>
						<c:out value="${page}" />
					</c:otherwise>
				</c:choose>
    		</c:forEach>
    		<c:if test="${list.hasNext}">&nbsp;<a href="${ctx }/article/list/<c:out value="${list.nextPage}" />">&gt;</a></c:if>
    	</td>
    </tr>
</table>    
</body>
</html>
	